<style type="text/css" scoped="scoped">
    textarea {
        min-width: 500px;
        min-height: 100px;
    }

    .limitEdit img {
        margin-top: 100px;
    }

    .package {
        margin-bottom: 20px;
        min-width: 500px;
    }

    .package ul li {
        margin: 5px 0px;
    }

    .package .limitName {
        width: 180px;
        display: inline-block;
    }

    .package ul li label {
        margin-right: 10px;
    }
</style>
<script type="text/javascript">
    $(document).ready(function (e) {
        LC.S.edit('.roleDetail .edit', LC.S.serviceUrl, '${role._id}');
        dialog('.limitEdit', {
            title: '编辑权限',
            autoOpen: false,
            modal: true,
            minWidth: 600,
            minHeight: 200
        });
        var limitEdit = $('<span class="icon-edit"></span>').click(function (e) {
            $('.limitEdit').load(LC.S.serviceUrl+'/limit.do')
            $('.limitEdit').dialog('open');
        });
        $('.rolelimit').prepend(limitEdit);
    });
    //var roleLimt = ${role.limit};
</script>
<div class="roleDetail">
    <input type="hidden" name="roleId" value="${role._id}">

    <div class="group">
        <div class="label">编 号：</div>
        <div class="value"><span class="roleId">${role._id}</span></div>
    </div>
    <div class="group">
        <div class="label">名 称：</div>
        <div class="value">
            <span class="edit" type="text" regx="${check.name}" name="NAME">${role.name}</span>
        </div>
    </div>
    <div class="group">
        <div class="label">备 注：</div>
        <div class="value"><span class="edit" type="textarea" name="NOTES" nullable>${role.notes}</span>
        </div>
    </div>
    <div class="group">
        <div class="label rolelimit">权 限：</div>
        <div class="value">
        <#list limitConfig as p>
            <fieldset class="package">
                <legend>${p.name}</legend>
                <ul>
                    <#list p.action as a>
                        <#if role.limit[a.key]??>
                            <li><span class="limitName">${a.name}</span>
                                <#list a.page as p>
                                    <label>${p.name}</label>
                                </#list>
                            </li>
                        </#if>
                    </#list>
                </ul>
            </fieldset>
        </#list>
        </div>
    </div>
    <div class="limitEdit">
        <img class="loading-img" src="images/loading.gif"/>
    </div>
</div>